import graph.graph as gt
import graph.basicproblem as gb

if __name__ == '__main__':
    V = ['u1', 'u2', 'u3', 'u4', 'u5', 'u6', 'u7', 'u8']
    E = {(5, 'u1', 'u2'), (2, 'u1', 'u3'), (3, 'u1', 'u4'), (6, 'u2', 'u5'),\
         (1, 'u3', 'u2'), (7, 'u3', 'u5'), (3, 'u3', 'u6'), (1, 'u3', 'u7'),\
         (6, 'u4', 'u3'), (1, 'u4', 'u7'), (5, 'u5', 'u8'), (1, 'u6', 'u5'),\
         (9, 'u6', 'u8'), (3, 'u7', 'u6'), (11, 'u7', 'u8')}
    [Hx, Pm] = gb.shortestpath(V, E, V[0], V[-1])
    print(Pm[1:])